//
//  FoodListTableViewCell.m
//  Funny
//
//  Created by dllo on 15/10/31.
//  Copyright © 2015年 King. All rights reserved.
//

#import "FoodListTableViewCell.h"

@implementation FoodListTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.imgView = [[UIImageView alloc]init];
        [self.contentView addSubview:self.imgView];
        self.imgView.layer.masksToBounds = YES;
        self.imgView.layer.cornerRadius = 5*W;
        
        self.chname = [[UILabel alloc]init];
        [self.contentView addSubview:self.chname];
        self.chname.font = [UIFont systemFontOfSize:16];
        self.chname.textColor = [UIColor grayColor];
        
        self.enname = [[UILabel alloc]init];
        [self.contentView addSubview:self.enname];
        self.enname.font = [UIFont systemFontOfSize:12];
        self.enname.textColor = [UIColor lightGrayColor];
        
        self.beento = [[UILabel alloc]init];
        [self.contentView addSubview:self.beento];
        self.beento.textAlignment = NSTextAlignmentRight;
        self.beento.font = [UIFont systemFontOfSize:12];
        self.beento.textColor = [UIColor lightGrayColor];
        
        self.keykey = [[UILabel alloc]init];
        [self.contentView addSubview:self.keykey];
        self.keykey.font = [UIFont systemFontOfSize:14];
        self.keykey.textColor = [UIColor redColor];
        
        
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.imgView.frame = CGRectMake( 10*W, 5*H, 150*W, 100*H);
    self.chname.frame = CGRectMake(175*W, 20*H, 200*W, 20*H);
    self.enname.frame = CGRectMake(175*W, 40*H, 100*W, 20*H);
    self.beento.frame = CGRectMake(200*W, 75*H, SelfWidth - 200 * W - 10, 20*H);
    self.keykey.frame = CGRectMake(175*W, 75*H, 100*W, 30*H);
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
